package io.gitee.kotle.android.library.websocket

import io.gitee.kotle.android.library.websocket.impl.okhttp.OkHttpWebSocketImpl
import io.gitee.kotle.android.utils.OkHttpCertUtil
import okhttp3.OkHttpClient
import java.time.Duration

/**
 *
 * 描述：
 *
 * @author jiale.wei
 *
 * 创建时间：2022/8/10 15:40
 *
 */
sealed class WebSocketStatus {


    /**
     * 连接成功
     */
    object ConnectSuccess : WebSocketStatus()

    /**
     * 连接失败
     */
    class ConnectFail(val error: WebSocketConnectError) : WebSocketStatus()

}

data class WebSocketConnectError(val code: Int, val msg: String)
/**
 * 创建对象
 */
fun createWebSocket(okHttpClient:OkHttpClient): IWebSocket {
    return OkHttpWebSocketImpl(okHttpClient)
}